/**
 * 
 */
package com.humi.partner.manager.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.humi.cloud.common.model.Result;
import com.humi.partner.common.entity.PartnerApplyRecord;
import com.humi.partner.front.model.PartnerBasePO;
import com.humi.partner.manager.entity.PartnerBaseQueryPO;
import com.humi.partner.manager.service.ManagerPartnerBaseService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;

/**
 * 
 * <pre>
 * <b>Description:</b> 
 * <b>Author:</b> TianJunmin
 * <b>Date:</b> 2019年10月11日
 * </pre>
 */
@RestController
@RequestMapping("/manager/partner_base")
@Api(tags = "中台-合作伙伴", protocols = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class ManagerPartnerBaseController {

	@Autowired 
	ManagerPartnerBaseService service;
	
	@PostMapping(value = "/getApplyPartnerList")
	@ApiOperation(value = "获取申请加入合作伙伴列表", response = PartnerBasePO.class)
	public Result getApplyPartnerList(@RequestBody PartnerBaseQueryPO po) {
		return service.getApplyPartnerList(po);
	}

	@PostMapping(value = "/getApplyPartnerRecordList/{partnerId}")
	@ApiOperation(value = "获取申请信息审核记录", response = PartnerApplyRecord.class)
	public Result getApplyPartnerRecordList(@ApiParam(value = "申请信息ID")@PathVariable(required = true) String partnerId) {
		return service.getApplyPartnerRecordList(partnerId);
	}
	
	@PostMapping(value = "/getApplyPartnerDetails/{partnerId}")
	@ApiOperation(value = "获取详细信息", response = PartnerBasePO.class)
	public Result getApplyPartnerDetails(@ApiParam(value = "申请信息ID")@PathVariable(required = true) String partnerId) {
		return service.getPartnerDetails(partnerId);
	}
	
	@PostMapping(value = "/applyPartnerInfo")
	@ApiOperation(value = "审核申请记录", response = Result.class)
	public Result applyPartnerInfo(@RequestBody PartnerApplyRecord record) {
		return service.applyPartnerInfo(record);
	}
}
